package de.baumann.browser.present.gg

import de.baumann.browser.api.OdinObserver
import de.baumann.browser.api.net.vo.gg.GGMain
import de.baumann.browser.base.BasePresenter
import de.baumann.browser.iview.gg.IGGMainView
import de.baumann.browser.model.endTime
import de.baumann.browser.model.prepositionByAddress
import de.baumann.browser.utils.getUser
import de.baumann.browser.utils.web3j.Erc20Util

class GGMainPresenter : BasePresenter<IGGMainView>() {
    fun a00(address:String) {
        var a = address
        if (address.startsWith("odx")){
            a = "0${address.substring(2)}"
        }
        prepositionByAddress(a)
                .subscribe(object : OdinObserver<GGMain>(view) {
                    override fun onSuccess(data: GGMain?) {
                        if (data != null) {
                            view.setData(data)
                        }
                    }
                })
    }

    fun a01(address: String){
//        var a = address
//        if (address.startsWith("odx")){
//            a = "0${address.substring(2)}"
//        }
//        endTime(a)
    }

}